<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript">
            var base_url = '';
            var Loader = function () { };
            Loader.prototype = {
                require: function (scripts, callback, type) {
                    this.loadCount      = 0;
                    this.totalRequired  = scripts.length;
                    if(type!='css'){
                        this.callback       = callback;
                    }
                    for (var i = 0; i < scripts.length; i++) {
                        this.writeScript(scripts[i], type);
                    }
                },
                loaded: function (evt) {
                    this.loadCount++;
                    if (this.loadCount == this.totalRequired && typeof this.callback == 'function') this.callback.call();
                },
                writeScript: function (src, type) {
                    if(type=='css'){
                        var s = document.createElement('link');
                        s.href = src;
                        s.rel = 'stylesheet';
                        s.type = 'text/css';
                        document.getElementsByTagName('head')[0].appendChild(s);
                    }else{
                        var self = this;
                        var s = document.createElement('script');
                        s.type = "text/javascript";
                        s.async = true;
                        s.src = src;
                        document.getElementsByTagName('head')[0].appendChild(s);
                        if (window.attachEvent){
                            window.attachEvent('onload', function (e) { self.loaded(e); });
                        }else{
                            window.addEventListener('load', function (e) { self.loaded(e); }, false);
                        }
                    }
                }
            };
            var ld = new Loader();
            var arr_css_files = [
                base_url+'bootstrap/css/bootstrap.min.css',
                base_url+'bootstrap/css/bootstrap-responsive.min.css',
                base_url+'css/styles.css'
            ];
            var arr_js_files = [
                base_url+'js/jquery-1.8.0.min.js',
                base_url+'js/php.full.namespaced.min.js',
                base_url+'js/base.js'
            ];
            ld.require(
                arr_css_files,
                '',
                'css'
            );
            ld.require(
                arr_js_files,
                function() {//callback function
                    var php = new PHP_JS();
                },
                'js'
            );
        </script>
        
    </head>
    <body>
        
    </body>
</html>
        
